package com.len.service.impl;

import com.len.base.BaseMapper;
import com.len.base.impl.BaseServiceImpl;
import com.len.entity.SysMenu;
import com.len.entity.SysRoleMenu;
import com.len.entity.TProductNotice;
import com.len.mapper.ProductMapper;
import com.len.service.ProductService;
import com.len.util.JsonUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductServiceImpl extends BaseServiceImpl<TProductNotice,Long> implements
        ProductService  {
    @Autowired
    private ProductMapper productMapper;
    @Override
    public BaseMapper<TProductNotice, Long> getMappser() {
        return productMapper;
    }

    @Override
    public JsonUtil del(String id) {
        JsonUtil json = new JsonUtil();
//        productMapper.delectByOrderNo(id);
        boolean isDel = productMapper.deleteByPrimaryKey(id) > 0;
        if (isDel) {
            json.setMsg("删除成功");
            json.setFlag(true);
        } else {
            json.setMsg("删除失败");
        }
        return json;
    }

    public List<TProductNotice> selectList(int begin, int end){
//        return productMapper.selectList(begin,end);
    return  null;
    }

    public List<TProductNotice> selectListByOrderNo(String orderNo){
        return productMapper.selectListByOrderNo(orderNo);
    }
}
